package com.yootk.consumer.action;

import com.yootk.common.dto.DeptDTO;
import com.yootk.service.IDeptService;
import feign.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer/dept/*") // 两个不同的服务路径
public class DeptConsumerAction { // 消费端Action
    @Autowired // 由容器帮助用户自动实例化接口对象
    private IDeptService deptService;
    @GetMapping("add") // 消费端接口名称
    public Object addDept(DeptDTO dto) {
        return this.deptService.add(dto);
    }
    @GetMapping("get")
    public Object get(Long deptno) {
        return this.deptService.get(deptno);
    }
    @GetMapping("list")
    public Object list() {
        return this.deptService.list();
    }
    @GetMapping("split")
    public Object split(int cp, int ls, String col, String kw) {
        return this.deptService.split(cp, ls, col, kw);
    }
}
